<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<link type="text/css" href="<?=Q::ini('custom_system/base_url')?>css/prettyphoto.css" rel="stylesheet" />
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/jq.prettyphoto.js"></script>
<script type="text/javascript">
$(function(){
	$("a[rel^='pretty_photo']").prettyPhoto({theme:'facebook'});
});
</script>
<table class="list_table" style="float: left;">
<caption>周销 TOP 20</caption>
<tr>
	<th width="50">排名</th>
	<th width="80">产品编号</th>
	<th width="300">产品名称</th>
	<th width="40">周销</th>
</tr>
<?$i=1;?>
<?foreach ($weekly_sales as $w):?>
<?if ($i>20){break;}?>
<tr>
	<td>
		<?=$i?>
		<span class="<?=Helper_BSS_Normal::getIniOne('product_sales_trend', 'value', $w['sales_trend'], 'icon_class')?>"></span>
	</td>
	<td>
		<?if ($w['pic_url']):?>
			<?$pretty_photo_number = 0;?>
			<?foreach ($w['pic_url'] as $wp):?>
			<a rel="pretty_photo[<?=$w['number']?>]" href="<?=$wp?>"><?if(!$pretty_photo_number):?><span class="img_icon"></span><?endif;?></a>
			<?$pretty_photo_number = 1;?>
			<?endforeach;?>
		<?endif;?>
		<?=$w['number']?>
	</td>
	<td align="left"><?=$w['name']?></td>
	<td><?=$w['weekly_sales']?></td>
</tr>
<?$i++;?>
<?endforeach;?>
</table>

<table class="list_table" style="float: left; margin-left:20px;">
<caption>月销 TOP 20</caption>
<tr>
	<th width="50">排名</th>
	<th width="80">产品编号</th>
	<th width="300">产品名称</th>
	<th width="40">月销</th>
</tr>
<?$i=1;?>
<?foreach ($monthly_sales as $m):?>
<?if ($i>20){break;}?>
<tr>
	<td>
		<?=$i?>
		<span class="<?=Helper_BSS_Normal::getIniOne('product_sales_trend', 'value', $m['sales_trend'], 'icon_class')?>"></span>
	</td>
	<td>
		<?if ($m['pic_url']):?>
			<?$pretty_photo_number = 0;?>
			<?foreach ($m['pic_url'] as $mp):?>
			<a rel="pretty_photo[<?=$m['number']?>]" href="<?=$mp?>"><?if(!$pretty_photo_number):?><span class="img_icon"></span><?endif;?></a>
			<?$pretty_photo_number = 1;?>
			<?endforeach;?>
		<?endif;?>
		<?=$m['number']?>
	</td>
	<td align="left"><?=$m['name']?></td>
	<td><?=$m['monthly_sales']?></td>
</tr>
<?$i++;?>
<?endforeach;?>
</table>
<?php $this->_endblock();?>